package com.qiangesoft.im.pojo.vo;

import com.qiangesoft.im.entity.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户
 *
 * @author qiangesoft
 * @date 2023-04-25
 */
@ApiModel(value = "用户")
@Data
public class SysUserVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    /**
     * entity to vo
     *
     * @param entity
     * @return
     */
    public static SysUserVo fromEntity(SysUser entity) {
        SysUserVo vo = new SysUserVo();
        vo.setId(entity.getId());
        vo.setAvatar(entity.getAvatar());
        vo.setNickName(entity.getNickName());
        return vo;
    }
}